public class SecuredElectronicDevice extends SecuredNotepad implements
		IElectronicDevice {

	boolean on;

	public SecuredElectronicDevice(int size) {
		super(size);
		on = false;
	}

	@Override
	public void start() {
		System.out.println("ON");
		on = true;
	}

	@Override
	public void stop() {
		System.out.println("OFF");
		on = false;
	}

	@Override
	public boolean isStarted() {
		return on;
	}

	@Override
	public void addTextToPage(String text, int page) {
		if (on) {
			super.addTextToPage(text, page);
		} else
			System.out.println("Device is Off");
	}

	@Override
	public void addNewTextToPage(String text, int page) {
		if (on) {
			super.addNewTextToPage(text, page);
		} else
			System.out.println("Device is Off");
	}

	@Override
	public void deleteTextFromPage(int page) {
		if (on) {
			super.deleteTextFromPage(page);
		} else
			System.out.println("Device is Off");
	}

	@Override
	public void printAllPages() {
		if (on) {
			super.printAllPages();
		} else
			System.out.println("Device is Off");
	}

	@Override
	public void searchWord(String word) {
		if (on) {
			super.searchWord(word);
		} else
			System.out.println("Device is Off");
	}

	@Override
	public void printAllPagesWithDigits() {
		if (on) {
			super.printAllPagesWithDigits();
		} else
			System.out.println("Device is Off");
	}

}
